<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Pragma" content="no-cache">
		<meta http-equiv="Cache-Control" content="no-cache">
		<meta http-equiv="Expires" content="0">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<title>购物车</title>
        <%@include file="../common/common.jsp" %>
	</head>
	<body >
		<header>
			<nav class="headerTwo">
				<img src="${ctx}/image/bg.png" alt="" />
				<h2>购物车(<i><%=cartItemsCount%></i>)</h2>
				<a href="#" class="jilu headWord"><span>编辑</span></a>
			</nav>
		</header>

		<section class="shoppingcart">
		   <c:if test="${not empty shops  }">
		        <c:forEach var="shop" items="${shops }">
		            <ul class="shoppingcart_goods">
						<li>
							<div class="shoppingcart_store">
								<a href="#">
									<input type="checkbox" class="checkBox" />
									<img src="${ctx}/image/yuan1.png" alt="" class="images" />
									<img class="storeImg" src="${ctx}/image/dian.png" alt="" />
									<span>${shop.shopName }</span>
									<img src="${ctx}/image/right.png" alt="" class="centerRight"/>
								    <span class="ShopTotal"></span>
								</a>
							</div>
							<c:set value="${shop.cartItems }"  var="cartItems"/>
							<c:if test="${not empty cartItems }">
							     <c:forEach items="${cartItems }" var="cart" varStatus="cartIndex">
							           <div class="shoppingcartDetail <c:if test='${cart.isValid =="1"}'>failure</c:if>">
											<a class="sdImg" href="#" cartId="${cart.id }">
											   <c:if test='${cart.isValid =="1"}'>
											        <span>失效</span>		
                                               </c:if> 
											   <c:if test='${cart.isValid =="0"}'>
                                                   <input type="checkbox" class="check" name="items" value="${cart.id}"  />												
												   <img src="${ctx}/image/yuan1.png" alt="" class="image" />
                                               </c:if>
												<a href="#<%-- ${ctx}/goods/queryGoodsDetail?id=${cart.productId } --%>"><img src="${cart.picture }" alt="${cart.productName }" class="sis" /></a>
												<a href="#<%-- ${ctx}/goods/queryGoodsDetail?id=${cart.productId } --%>"><p class="sdWordA moreWord">${cart.productName }</p></a>
												<c:set value="${cart.goods_sku_info}" var="skuInfo"/>	
								                <c:set value="${cart.goodsSkuList }" var="goodsSkuList"/>			
												<p class="sdWordC" goodsSkuId="${cart.goods_sku_id}" statusIndex="${cartIndex.index }">			    
													<c:if test="${not empty skuInfo && fn:length(fn:split(skuInfo,',')) >0 }">
													     <c:set value="${fn:split(skuInfo,',')}" var="skuInfoArr"/>	
													     <c:forEach var="sku" items="${skuInfoArr }">
													           <c:set value="${fn:split(sku,':')}" var="sku_"/>
													           <span >
														           ${sku_[0]}:
														           <c:if test="${fn:indexOf(sku_[0],'颜色') != -1 }">										           
														                <i>${fn:split(sku,':')[1]}</i>
														           </c:if>
														           <c:if test="${fn:indexOf(sku_[0],'尺码') != -1 }">											           
														                <b>${fn:split(sku,':')[1]}</b>
														           </c:if>												             
													            </span>										                 							                  
											             </c:forEach>
													</c:if>
													<c:if test="${empty skuInfo || fn:length(fn:split(skuInfo,',')) ==0 }">
												        <span>暂无规格</span>
												    </c:if>
													<img src="${ctx}/image/down.png" alt="" />
										        </p>
												
												<c:choose>
												    <c:when test="${cart.discountMarketPrice != null}">
											          	<p class="sdWordP "><b>￥</b><i>${cart.discountMarketPrice}</i></p>	
												    </c:when>
												    <c:otherwise>
											          	<p class="sdWordP "><b>￥</b><i>${cart.marketPrice}</i></p>	
												    </c:otherwise>
												</c:choose>	
											</a>
		 									<div class="mengban <c:if test='${cart.isValid =="1"}'>failure</c:if>">
									
											</div>
											<div class="attribute <c:if test='${cart.isValid =="1"}'>failure</c:if>">
													<div class="attributes">
														<a href="#<%-- ${ctx}/goods/queryGoodsDetail?id=${cart.productId } --%>"><img src="${cart.picture }" alt="${cart.productName }" /></a>
														<p>
															<span class="wordO">${cart.productName }</span>
															<c:choose>
															    <c:when test="${cart.discountMarketPrice != null}">
														          	<span><b>¥ </b><b>${cart.discountMarketPrice}</b></span>
															    </c:when>
															    <c:otherwise>
														          	<span><b>¥ </b><b>${cart.marketPrice}</b></span>
															    </c:otherwise>
															</c:choose>	
															<span>库存${cart.stock }件</span>
														</p>
														<img src="${ctx}/image/fxclose.png" alt="" class="fr" />
													</div>
													<ul class="addAttributes clearfix addAttr">
													  <c:forEach var="goodsSku" items="${goodsSkuList}" >
													       <c:set value="${goodsSku.goodsSkuValueList }" var="goodsSkuValueList"/>	
													        <li>${goodsSku.name }</li>
													        <li class="clearfix    <c:if test="${fn:indexOf(goodsSku.name,'尺码') !=-1 }">goodesF</c:if> <c:if test="${fn:indexOf(goodsSku.name,'颜色') !=-1 }">goodesT</c:if> ">
													            <c:forEach var="goodsSkuValue" items="${goodsSkuValueList }" varStatus="skuValueStatus">											   
																	 <a href="javascript:;"  <c:if test="${fn:indexOf(cart.goods_sku_info,goodsSkuValue.valueName) !=-1 }"> style='border: 1px solid rgb(202, 14, 84); color: rgb(202, 14, 84);'</c:if> id="${goodsSkuValue.valueId}" name="${goodsSku.name}:${goodsSkuValue.valueName }" class="fl" cartId="${cart.id}" >${goodsSkuValue.valueName }<i></i></a>
																</c:forEach>
														    </li>
													  </c:forEach>														
													</ul>
													<a href="#" class="addAs" id ="${cart.id }">确定</a>
									    </div>
										<div class="shoppingcartN <c:if test='${cart.isValid =="1"}'>shoppingcartNfailure</c:if>">
											<a href="javascript:;" style="display:none" class="scnImg"><img src="${ctx}/image/jian.png" alt="" /></a>
											<input type="text" name="" id="" value="${cart.quantity }" class="shu"  style="margin-left:3.5rem;border-left: 0px solid #ccc;border-right: 0px solid #ccc;" readonly="readonly"/>
											<a href="javascript:;" style="display:none"  class="jia" ><img src="${ctx}/image/jia.png" alt="" /></a>
										</div>
										<div class="jsb <c:if test='${cart.isValid =="1"}'>failure</c:if>">
												<c:if test='${cart.isValid =="1"}'>
												  <a href="#" id ="${cart.id }"  class="del ">删除</a>
												  </c:if>
                                                  <img src="${ctx}/image/bianji.png" alt="" class="fImg" statusIndex="${cartIndex.index }" style="<c:if test='${cart.isValid =="1"}'>display: none;</c:if>" />
												<p style="<c:if test='${cart.isValid =="1"}'>display: none;</c:if>">
													<a href="#" id ="${cart.id }" class="del ">删除</a>
													<a href="#" class="ach " id ="${cart.id }">完成</a>
												</p>
										</div>
									</div>
							     </c:forEach>
							</c:if>
						</li>
					</ul>
		        </c:forEach>
		   </c:if>
		</section>

		<div class="jiesuan jie clearfix">
			<input type="checkbox" class=" check_all fl" />
			<img src="${ctx}/image/yuan1.png" alt="" class="image fl" />
			<span class="fl">全选</span>
			<a href="javascript:void(0)" class="fr tallyOrders">
				<p>结算(<i class="tallMonut">0</i>)</p>
			</a>
			<p class="fr">
				<span><b>￥</b><i class="jiage">0.00</i></span>
				<span>不含运费</span>
			</p>
			<span class="fr">合计 ：</span>
		</div>
		<div class="editor jiesuan clearfix">
			<input type="checkbox" class=" check_all fl" />
			<img src="${ctx}/image/yuan1.png" alt="" class="image fl" />
			<span class="fl">全选</span>
			<a href="#" class="fr">
				<p>删除</p>
			</a>
			<span class="fr">移入收藏夹</span>
			<span class="fr">分享</span>
			<span class="fr">清除失效宝贝</span>

		</div>
		
		<!-- 引入底部标签  开始 -->
		<%@include file="../common/bottom.jsp" %>
		<!-- 引入底部标签  结束 -->
	
		<script type="text/javascript" src="${ctx}/js/cart/shoppingCart.js"></script>
	</body>

</html>
